package com.tools.ad.adscene;

import android.support.annotation.Keep;
import android.view.View;

import com.hm.base.android.mob.AMApplication;
import com.tools.ad.EntranceType;
import com.tools.ad.util.ShareUtils;

/**
 * desc:
 * date: 2018/1/4
 * author: ancun
 */

public abstract class AdScene {

    protected AMApplication imContext;
    protected EntranceType mEntranceType;

    @Keep
    public AdScene(AMApplication context) {
        imContext = context;
    }

    @Keep
    public AdScene(AMApplication context, EntranceType entranceType) {
        imContext = context;
        mEntranceType = entranceType;
    }

    /**
     * 是否安装了Facebook
     *
     * @return
     */
    protected boolean isFaceBookInstall() {
        return ShareUtils.isInstallFaceBook(imContext);
    }

    /**
     * 加载广告
     *
     * @param forceLoad 是否忽略配置检查，强制加载广告
     * @return
     */
    public abstract boolean load(boolean forceLoad);

    /**
     * 释放广告
     */
    public abstract void release();

    public abstract View getAdView();

    public int getPlaceId(){
        return 0;
    }

}
